A demonstration of the :required selector.

An optional input element:

A required input element:

The :required selector selects form elements with a "required" attribute.

The :required selector is not supported in Internet Explorer 9 or earlier versions.